package a.f.l;

import a.a.hb;
import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.i;
import a.c.j;
import a.c.x;
import a.c.z;
import a.d.t;
import a.f.o;
import a.i.db;
import a.i.l;

import java.util.*;

public class s
{
  public static final Object a = "y.layout.router.BusRepresentations.SOURCE_ID_DPKEY";
  public static final Object b = "y.layout.router.BusRepresentations.TARGET_ID_DPKEY";
  public static int c;
  
  public static ab[] a(a.c.q paramq, a.c.k paramk)
  {
    int j = g.Cc;
    int i = g.Bc;
    z localz = new z();
    x localx = paramq.B();
    Object localObject1 = paramq.w();
    Object localObject2;
    Object localObject3;
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      if (j == 0)
      {
        if (!paramk.getBool(((d)localObject2).e()))
        {
          if (j != 0) {
            continue;
          }
          if (!paramk.getBool(((d)localObject2).f()))
          {
            localObject3 = new ab();
            ((ab)localObject3).add(localObject2);
            localz.add(localObject3);
          }
        }
        ((a.c.m)localObject1).f();
      }
    } while (i == 0);
    localObject1 = paramq.v();
    label414:
    do
    {
      while (i == 0)
      {
        if (!((a.c.w)localObject1).e()) {
          break;
        }
        if (j == 0)
        {
          if ((paramk.getBool(((a.c.w)localObject1).d())) && (!localx.getBool(((a.c.w)localObject1).d())))
          {
            localObject2 = new ab();
            localObject3 = new bb();
            do
            {
              ((bb)localObject3).add(((a.c.w)localObject1).d());
              e locale1;
              a.c.m localm;
              while (!localm.e())
              {
                do
                {
                  if (((bb)localObject3).isEmpty()) {
                    break;
                  }
                  locale1 = ((bb)localObject3).o();
                } while ((j == 0) && (localx.getBool(locale1)));
                localx.a(locale1, true);
                localm = locale1.l();
              }
              e locale2 = localm.a().a(locale1);
              if (j != 0) {
                break label414;
              }
              do
              {
                if (i != 0) {
                  break;
                }
              } while (j != 0);
              if (i != 0) {
                break label414;
              }
              if (!paramk.getBool(locale2))
              {
                ((ab)localObject2).add(localm.a());
                if (j != 0) {
                  continue;
                }
                if (i == 0) {}
              }
              else
              {
                if (j != 0) {
                  continue;
                }
                if (paramk.getBool(locale2))
                {
                  if (j != 0) {
                    continue;
                  }
                  if (!localx.getBool(locale2))
                  {
                    ((bb)localObject3).b(locale2);
                    ((ab)localObject2).add(localm.a());
                  }
                }
              }
              localm.f();
            } while (i == 0);
            if (j != 0) {
              break label449;
            }
            if (!((ab)localObject2).isEmpty()) {
              localz.add(localObject2);
            }
          }
          ((a.c.w)localObject1).f();
        }
      }
      paramq.a(localx);
    } while (j != 0);
    label449:
    return (ab[])localz.toArray(new ab[localz.size()]);
  }
  
  public static ab a(o paramo, a.c.k paramk, i parami)
  {
    return a(paramo, a(paramo, paramk), paramk, a.i.q.a(Boolean.FALSE), parami);
  }
  
  public static ab a(o paramo, ab[] paramArrayOfab, a.c.k paramk1, a.c.k paramk2, i parami)
  {
    if (paramArrayOfab.length == 0) {
      return new ab();
    }
    paramo.z();
    ab localab;
    try
    {
      localab = c(paramo, paramArrayOfab, paramk1, paramk2, parami);
    }
    finally
    {
      paramo.A();
    }
    return localab;
  }
  
  private static ab c(o paramo, ab[] paramArrayOfab, a.c.k paramk1, a.c.k paramk2, i parami)
  {
    int i3 = g.Cc;
    int i2 = g.Bc;
    a.c.k localk1 = paramo.c(a);
    a.c.k localk2 = paramo.c(b);
    i locali1;
    i locali2;
    if ((i3 != 0) || (((localk1 instanceof i)) && ((i3 != 0) || ((localk2 instanceof i)))))
    {
      locali1 = (i)localk1;
      locali2 = (i)localk2;
      if (i2 == 0) {}
    }
    else
    {
      locali1 = null;
      locali2 = null;
    }
    a.c.n localn1 = paramo.C();
    a.c.n localn2 = paramo.C();
    a.i.y localy = new a.i.y(paramo);
    localy.c();
    ab localab1 = new ab();
    bb localbb1 = new bb();
    int i = 0;
    label285:
    label315:
    label316:
    label959:
    label979:
    label992:
    do
    {
      if (i >= paramArrayOfab.length) {
        break;
      }
      ab localab2 = paramArrayOfab[i];
      Integer localInteger = new Integer(i);
      localy.b(localab2);
      if ((i3 == 0) && (i2 != 0)) {
        break label1181;
      }
      if (!localab2.isEmpty())
      {
        bb localbb2 = new bb();
        bb localbb3 = new bb();
        Object localObject1 = paramo.v();
        do
        {
          if (!((a.c.w)localObject1).e()) {
            break;
          }
          localObject2 = ((a.c.w)localObject1).d();
          if (i3 != 0) {
            break label316;
          }
          if (i2 != 0) {
            break label315;
          }
          if (((e)localObject2).c() != 0)
          {
            if (i3 == 0) {
              if (paramk1.getBool(localObject2))
              {
                localbb2.add(localObject2);
                if (i3 != 0) {
                  continue;
                }
                if (i2 == 0) {
                  break label285;
                }
              }
            }
            localbb3.add(localObject2);
          }
          ((a.c.w)localObject1).f();
        } while (i2 == 0);
        localbb1.addAll(localbb2);
        if (i3 == 0)
        {
          if (i3 == 0) {
            if (localbb3.size() < 2)
            {
              localy.a(localbb2.l());
              if ((i3 == 0) && (i2 == 0)) {
                break label1163;
              }
            }
          }
          if ((i3 != 0) || (localab2.size() == 1))
          {
            localObject1 = localab2.m();
            localab1.add(localObject1);
            parami.a(localObject1, new r(localInteger, paramk2.getBool(localObject1), new Integer(0), new Integer(0)));
            localy.a((d)localObject1);
            break label1163;
          }
        }
        localObject1 = localbb3.p();
        Object localObject2 = new ab[localObject1.length];
        int j = 0;
        do
        {
          if (j >= localObject1.length) {
            break;
          }
          localObject2[j] = new ab(localObject1[j].l());
          j++;
          if (i3 != 0) {
            break label1168;
          }
          if (i2 != 0) {
            break label1166;
          }
        } while (i2 == 0);
        ab localab3 = new ab();
        if (i3 != 0) {
          continue;
        }
        int k = 0;
        Object localObject5;
        do
        {
          if (k >= localObject1.length) {
            break;
          }
          localObject3 = localObject1[k];
          int m = 0;
          if (i3 != 0) {
            break label992;
          }
          if (i2 != 0) {
            break label979;
          }
          localObject5 = localObject2[k].l();
          do
          {
            do
            {
              if (!((a.c.m)localObject5).e()) {
                break label959;
              }
              d locald1 = ((a.c.m)localObject5).a();
              boolean bool1 = localObject3.equals(locald1.e());
              if (i2 != 0) {
                break;
              }
              a.d.w localw1 = bool1 ? paramo.p(locald1) : paramo.q(locald1);
              int n = k + 1;
              do
              {
                if (n >= localObject1.length) {
                  break;
                }
                e locale = localObject1[n];
                int i1 = 0;
                if (i3 != 0) {
                  break label954;
                }
                if (i2 != 0) {
                  break label946;
                }
                a.c.m localm = localObject2[n].l();
                do
                {
                  do
                  {
                    if (!localm.e()) {
                      break label926;
                    }
                    d locald2 = localm.a();
                    boolean bool2 = locale.equals(locald2.e());
                    if (i2 != 0) {
                      break;
                    }
                    a.d.w localw2 = bool2 ? paramo.p(locald2) : paramo.q(locald2);
                    d locald3 = paramo.a((e)localObject3, locale);
                    paramo.a(locald3, localw1);
                    paramo.b(locald3, localw2);
                    parami.a(locald3, new r(localInteger, (paramk2.getBool(locald1)) && (paramk2.getBool(locald2)), new Integer(m), new Integer(i1)));
                    localn1.a(locald3, locald1);
                    localn2.a(locald3, locald2);
                    localab3.add(locald3);
                    if (i3 == 0)
                    {
                      if (locali1 != null)
                      {
                        Object localObject6 = bool1 ? localk1.get(locald1) : localk2.get(locald1);
                        Object localObject7 = bool2 ? localk1.get(locald2) : localk2.get(locald2);
                        locali1.a(locald3, localObject6);
                        locali2.a(locald3, localObject7);
                      }
                      localm.f();
                      i1++;
                    }
                  } while (i2 == 0);
                  n++;
                } while (i3 != 0);
              } while (i2 == 0);
              if (i3 == 0)
              {
                ((a.c.m)localObject5).f();
                m++;
              }
            } while (i2 == 0);
            k++;
          } while (i3 != 0);
        } while (i2 == 0);
        if (i3 == 0)
        {
          localab1.addAll(localab3);
          localy.a(localab3);
        }
        a.c.n localn3 = paramo.C();
        Object localObject3 = c(paramo, paramk1, localn3);
        localy.b(localab3);
        Object localObject4 = localab3.l();
        do
        {
          if (!((a.c.m)localObject4).e()) {
            break;
          }
          localObject5 = ((a.c.m)localObject4).a();
          localn1.a(localObject5, localn3.get(localn1.get(localObject5)));
          localn2.a(localObject5, localn3.get(localn2.get(localObject5)));
          ((a.c.m)localObject4).f();
          if (i3 != 0) {
            break label1168;
          }
          if (i2 != 0) {
            break label1166;
          }
        } while (i2 == 0);
        localObject4 = new d_();
        ((d_)localObject4).a(false);
        ((d_)localObject4).a(localab3.l(), (o)localObject3, localn1, localn2);
        localy.a(localbb2.l());
        if (i3 != 0) {
          break label1178;
        }
        localy.c();
      }
      i++;
    } while (i2 == 0);
    label926:
    label946:
    label954:
    if (i3 == 0) {
      localy.g();
    }
    label1163:
    label1166:
    label1168:
    label1178:
    label1181:
    a.c.w localw = localbb1.l();
    if (localw.e()) {}
    do
    {
      paramo.a(localw.d());
      localw.f();
      if ((i3 == 0) && (i2 != 0)) {
        break label1248;
      }
      if (i2 == 0) {
        break;
      }
      paramo.a(localn1);
    } while (i3 != 0);
    paramo.a(localn2);
    label1248:
    return localab1;
  }
  
  public static void a(o paramo, a.c.m paramm, a.c.k paramk, i parami)
  {
    paramo.z();
    try
    {
      c(paramo, paramm, paramk, parami);
    }
    finally
    {
      paramo.A();
    }
  }
  
  private static void c(o paramo, a.c.m paramm, a.c.k paramk, i parami)
  {
    int k = g.Cc;
    int j = g.Bc;
    a.c.k localk1 = paramo.c(a);
    a.c.k localk2 = paramo.c(b);
    Map localMap = (k != 0) || (((localk1 instanceof i)) && ((localk2 instanceof i))) ? new HashMap() : null;
    b.d_[] arrayOfd_ = b.a(paramo, paramm, paramk);
    HashMap localHashMap = new HashMap();
    x localx = paramo.B();
    Object localObject1 = paramo.v();
    do
    {
      while (j == 0)
      {
        if (!((a.c.w)localObject1).e()) {
          break;
        }
        localx.a(((a.c.w)localObject1).d(), true);
        ((a.c.w)localObject1).f();
      }
    } while (k != 0);
    localObject1 = new a.i.y(paramo);
    try
    {
      int i = 0;
      label323:
      label452:
      do
      {
        do
        {
          if (i >= arrayOfd_.length) {
            break;
          }
          localObject2 = arrayOfd_[i];
          localObject3 = a(paramo, ((b.d_)localObject2).e());
          localObject4 = new f_();
          Object localObject5;
          Object localObject6;
          do
          {
            if (j != 0) {
              break label493;
            }
            localObject5 = ((b.d_)localObject2).e();
            do
            {
              if (!((a.c.m)localObject5).e()) {
                break label323;
              }
              localObject6 = ((a.c.m)localObject5).a();
              a.d.w[] arrayOfw = b.b(paramo.n((d)localObject6).h());
              ((f_)localObject4).a(arrayOfw);
              ((f_)localObject4).a(arrayOfw[0]);
              ((f_)localObject4).a(arrayOfw[(arrayOfw.length - 1)]);
              if (j != 0) {
                break;
              }
              if (localMap != null)
              {
                localMap.put(arrayOfw[0], localk1.get(localObject6));
                localMap.put(arrayOfw[(arrayOfw.length - 1)], localk2.get(localObject6));
              }
              ((a.c.m)localObject5).f();
            } while (j == 0);
            ((a.i.y)localObject1).a(((b.d_)localObject2).e());
            ((f_)localObject4).b();
            localObject5 = new b_(null).a(paramo, ((f_)localObject4).a, (Map)localObject3, localMap);
            localHashMap.put(((b.d_)localObject2).c(), localObject5);
          } while (k != 0);
          if (parami != null)
          {
            localObject6 = ((ab)localObject5).l();
            do
            {
              if (!((a.c.m)localObject6).e()) {
                break;
              }
              parami.a(((a.c.m)localObject6).a(), ((b.d_)localObject2).c());
              ((a.c.m)localObject6).f();
              if (k != 0) {
                break label452;
              }
              if (j != 0) {
                break label450;
              }
            } while (j == 0);
          }
          if (k == 0) {
            i++;
          }
        } while (j == 0);
        ((a.i.y)localObject1).g();
      } while (k != 0);
      label450:
      i = 0;
      label493:
      do
      {
        if (i >= arrayOfd_.length) {
          break;
        }
        localObject2 = arrayOfd_[i];
        if (j != 0) {
          return;
        }
        localObject3 = ((b.d_)localObject2).e();
        if (((a.c.m)localObject3).e())
        {
          paramo.a(((a.c.m)localObject3).a());
          ((a.c.m)localObject3).f();
        }
        for (;;)
        {
          if (k == 0) {
            if (j == 0)
            {
              if (j == 0) {
                break;
              }
              if (k != 0) {
                continue;
              }
              i++;
            }
          }
        }
      } while (j == 0);
      if (k != 0) {}
    }
    catch (IllegalStateException localIllegalStateException)
    {
      Object localObject3;
      Object localObject4;
      Object localObject2 = localHashMap.values().iterator();
      do
      {
        while (!((a.c.m)localObject4).e())
        {
          if (!((Iterator)localObject2).hasNext()) {
            break;
          }
          localObject3 = (ab)((Iterator)localObject2).next();
          localObject4 = ((ab)localObject3).l();
        }
        if ((k != 0) || (j != 0)) {
          break label664;
        }
        paramo.a(((a.c.m)localObject4).a());
        ((a.c.m)localObject4).f();
      } while ((k == 0) && ((j == 0) && (j == 0)));
      label664:
      localObject2 = paramo.v();
      do
      {
        if (!((a.c.w)localObject2).e()) {
          break;
        }
        localObject3 = ((a.c.w)localObject2).d();
        if ((k == 0) && (j != 0)) {
          break label743;
        }
        if (k == 0)
        {
          if (!localx.getBool(localObject3)) {
            paramo.a((e)localObject3);
          }
          ((a.c.w)localObject2).f();
        }
      } while (j == 0);
      if (k == 0) {
        ((a.i.y)localObject1).g();
      }
      label743:
      throw localIllegalStateException;
    }
    finally
    {
      paramo.a(localx);
    }
  }
  
  static ab a(b.d_ paramd_, ab paramab, Collection paramCollection)
  {
    int j = g.Cc;
    int i = g.Bc;
    o localo = paramd_.d();
    f_ localf_ = new f_();
    if ((j != 0) || (paramCollection != null))
    {
      localObject1 = paramCollection.iterator();
      do
      {
        if (!((Iterator)localObject1).hasNext()) {
          break;
        }
        localObject2 = (a.d.n)((Iterator)localObject1).next();
        localf_.a(((a.d.n)localObject2).d(), ((a.d.n)localObject2).e(), true);
      } while (i == 0);
    }
    Object localObject1 = paramab.l();
    do
    {
      do
      {
        if (!((a.c.m)localObject1).e()) {
          break;
        }
        localf_.a(b.b(localo.n(((a.c.m)localObject1).a()).h()));
        ((a.c.m)localObject1).f();
        if (j != 0) {
          break label162;
        }
        if (i != 0) {
          break label155;
        }
      } while (i == 0);
    } while (j != 0);
    localObject1 = paramd_.g();
    label155:
    label162:
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      localf_.a(paramd_.b((d)localObject2).e());
      localf_.a(paramd_.c((d)localObject2).e());
      ((a.c.m)localObject1).f();
      if ((j == 0) && (i != 0)) {
        break label234;
      }
    } while (i == 0);
    if (j == 0) {
      localf_.b();
    }
    label234:
    localObject1 = localo.C();
    Object localObject2 = localo.C();
    ab localab1 = new ab();
    ab localab2 = new ab();
    Object localObject3 = paramd_.g();
    label432:
    do
    {
      if (!((a.c.m)localObject3).e()) {
        break;
      }
      d locald = ((a.c.m)localObject3).a();
      e locale1 = (e)localf_.b.get(paramd_.b(locald).e());
      e locale2 = (e)localf_.b.get(paramd_.c(locald).e());
      if (j == 0)
      {
        if ((locale1 == null) || ((j == 0) && (locale1.i() == null)) || ((j == 0) && (locale2 == null)) || (locale2.i() == null)) {
          localab1.add(locald);
        }
      }
      else
      {
        if (j != 0) {
          continue;
        }
        if (i == 0) {
          break label432;
        }
      }
      localab2.add(locald);
      ((a.c.n)localObject1).a(locald, locale1.i());
      ((a.c.n)localObject2).a(locald, locale2.i());
      ((a.c.m)localObject3).f();
    } while (i == 0);
    localObject3 = new d_();
    if (j == 0) {}
    ((d_)localObject3).a(paramd_.f().k() == 0);
    ((d_)localObject3).a(localab2.l(), localf_.a, (a.c.k)localObject1, (a.c.k)localObject2);
    localo.a((a.c.n)localObject1);
    localo.a((a.c.n)localObject2);
    return localab1;
  }
  
  private static Map a(o paramo, a.c.m paramm)
  {
    int j = g.Cc;
    int i = g.Bc;
    HashMap localHashMap = new HashMap();
    paramm.h();
    do
    {
      if (!paramm.e()) {
        break;
      }
      d locald = paramm.a();
      localHashMap.put(b.a(paramo.r(locald)), locald.e());
      if ((j == 0) && (i != 0)) {
        break label100;
      }
      localHashMap.put(b.a(paramo.s(locald)), locald.f());
      paramm.f();
    } while (i == 0);
    label100:
    return localHashMap;
  }
  
  private static o c(o paramo, a.c.k paramk, i parami)
  {
    int k = g.Cc;
    int j = g.Bc;
    a.f.q localq = new a.f.q();
    x localx = paramo.B();
    a.d.s locals = new a.d.s(10.0D, 10.0D);
    Object localObject1 = paramo.v();
    Object localObject2;
    e locale1;
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.w)localObject1).d();
      if (paramk.getBool(localObject2))
      {
        locale1 = localq.i();
        localq.a(locale1, paramo.u((e)localObject2));
        localq.b(locale1, paramo.r((e)localObject2));
        localx.a(localObject2, locale1);
      }
      ((a.c.w)localObject1).f();
    } while (j == 0);
    localObject1 = paramo.w();
    label247:
    label507:
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      if ((k != 0) || (paramk.getBool(((d)localObject2).e())))
      {
        locale1 = (e)localx.get(((d)localObject2).e());
        if (k != 0) {
          break label247;
        }
        if (j == 0) {}
      }
      else
      {
        locale1 = localq.i();
        localq.a(locale1, locals);
        localq.a(locale1, b.a(paramo.r((d)localObject2)));
      }
      e locale2;
      if ((k != 0) || (paramk.getBool(((d)localObject2).f())))
      {
        locale2 = (e)localx.get(((d)localObject2).f());
        if (k == 0) {
          if (j == 0) {
            break label306;
          }
        }
      }
      else
      {
        locale2 = localq.i();
        localq.a(locale2, locals);
      }
      localq.a(locale2, b.a(paramo.s((d)localObject2)));
      a.d.w[] arrayOfw = paramo.n((d)localObject2).h();
      ab localab = new ab();
      Object localObject3 = locale1;
      int i = 1;
      do
      {
        do
        {
          if (i >= arrayOfw.length - 1) {
            break;
          }
          e locale3 = localq.i();
          localq.a(locale3, locals);
          localq.a(locale3, b.a(arrayOfw[i]));
          localab.add(localq.a((e)localObject3, locale3));
          localObject3 = locale3;
          i++;
          if (k != 0) {
            break label437;
          }
          if (j != 0) {
            break label426;
          }
        } while (j == 0);
      } while (k != 0);
      localab.add(localq.a((e)localObject3, locale2));
      d locald;
      if (k == 0) {
        if (!paramk.getBool(((d)localObject2).e()))
        {
          locald = localab.m();
          localq.e(locald);
          parami.a(localObject2, locald);
          break label507;
        }
      }
      if (k == 0)
      {
        if (!paramk.getBool(((d)localObject2).f()))
        {
          locald = localab.n();
          parami.a(localObject2, locald);
        }
        ((a.c.m)localObject1).f();
      }
    } while (j == 0);
    label306:
    label437:
    return localq;
  }
  
  private static a.d.w[] a(a.d.w paramw1, a.d.w paramw2, boolean paramBoolean)
  {
    double d1 = b.a(paramw1, paramBoolean);
    double d2 = b.a(paramw2, paramBoolean);
    if (g.Cc == 0) {
      if (d1 < d2) {
        return new a.d.w[] { paramw1, paramw2 };
      }
    }
    return new a.d.w[] { paramw2, paramw1 };
  }
  
  private static class g_
    implements j
  {
    private double a;
    private final j b;
    private final double c;
    
    private g_(j paramj, double paramDouble)
    {
      this.b = paramj;
      this.c = paramDouble;
      this.a = -1.797693134862316E+308D;
    }
    
    public j a()
    {
      return this.b;
    }
    
    public void a(Object paramObject1, Object paramObject2)
    {
      if ((paramObject2 instanceof Double)) {
        a(paramObject1, ((Double)paramObject2).doubleValue());
      }
    }
    
    public void a(Object paramObject, double paramDouble)
    {
      int i = g.Cc;
      this.b.a(paramObject, paramDouble);
      if (((i != 0) || (!Double.isInfinite(paramDouble))) && ((i != 0) || ((!Double.isNaN(paramDouble)) && (paramDouble > this.a)))) {
        this.a = paramDouble;
      }
    }
    
    public Object get(Object paramObject)
    {
      return new Double(getDouble(paramObject));
    }
    
    public double getDouble(Object paramObject)
    {
      int i = g.Cc;
      double d = this.b.getDouble(paramObject);
      if (i == 0) {
        if (!Double.isNaN(d))
        {
          if (i != 0) {
            break label57;
          }
          if (!Double.isInfinite(d)) {
            break label42;
          }
        }
      }
      return 0.0D;
      label42:
      label57:
      return this.c + Math.max(this.a - d, 0.0D);
    }
    
    public Object a(Object paramObject)
    {
      return this.b.get(paramObject);
    }
    
    public double b(Object paramObject)
    {
      return this.b.getDouble(paramObject);
    }
    
    public void a(Object paramObject, int paramInt)
    {
      throw new UnsupportedOperationException();
    }
    
    public void a(Object paramObject, boolean paramBoolean)
    {
      throw new UnsupportedOperationException();
    }
    
    public int getInt(Object paramObject)
    {
      throw new UnsupportedOperationException();
    }
    
    public boolean getBool(Object paramObject)
    {
      throw new UnsupportedOperationException();
    }
    
    g_(j paramj, double paramDouble, s.7 param7)
    {
      this(paramj, paramDouble);
    }
  }
  
  private static class c_
    implements a.d.p
  {
    private final d a;
    private final kb b;
    private final t c;
    private final Set d;
    
    c_(d paramd)
    {
      a.d.w[] arrayOfw = b.b(((o)paramd.c()).n(paramd).h());
      if (g.Cc == 0) {
        if (arrayOfw.length != 2) {
          throw new IllegalArgumentException("Edge path length must be equal to 2.");
        }
      }
      Arrays.sort(arrayOfw);
      this.a = paramd;
      this.b = new kb(arrayOfw[0].a, arrayOfw[0].b, arrayOfw[1].a, arrayOfw[1].b);
      this.c = new t(arrayOfw[0].a, arrayOfw[0].b, arrayOfw[1].a - arrayOfw[0].a, arrayOfw[1].b - arrayOfw[0].b);
      this.d = new HashSet();
    }
    
    public t a()
    {
      return this.c;
    }
    
    kb b()
    {
      return this.b;
    }
    
    d c()
    {
      return this.a;
    }
    
    void a(a.d.w paramw)
    {
      this.d.add(paramw);
    }
    
    z d()
    {
      int i = g.Cc;
      z localz = new z(this.d);
      a.d.w[] arrayOfw = b.b(((o)this.a.c()).n(this.a).h());
      if (i == 0) {
        if (!this.d.contains(arrayOfw[0])) {
          localz.add(arrayOfw[0]);
        }
      }
      if ((i != 0) || (!this.d.contains(arrayOfw[(arrayOfw.length - 1)]))) {
        localz.add(arrayOfw[(arrayOfw.length - 1)]);
      }
      Collections.sort(localz);
      return localz;
    }
  }
  
  private static class e_
    implements Comparable
  {
    private static final int a = 0;
    private static final int b = 1;
    private static final int c = 2;
    private final int d;
    private final a.d.w e;
    private final a.d.w f;
    private final boolean g;
    private final boolean i;
    
    private e_(a.d.w paramw, boolean paramBoolean)
    {
      this(paramw, null, 1, paramBoolean, false);
    }
    
    private e_(a.d.w paramw1, a.d.w paramw2, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
    {
      this.f = paramw2;
      this.d = paramInt;
      this.e = paramw1;
      this.g = paramBoolean1;
      this.i = paramBoolean2;
    }
    
    private int a()
    {
      return this.d;
    }
    
    private double b()
    {
      return b.a(this.e, this.g);
    }
    
    private a.d.w d()
    {
      return this.e;
    }
    
    private boolean f()
    {
      return this.g;
    }
    
    public boolean g()
    {
      return this.i;
    }
    
    public int compareTo(Object paramObject)
    {
      e_ locale_ = (e_)paramObject;
      int j = b.b(b(), locale_.b());
      if (g.Cc == 0) {
        if (j == 0) {
          return l.a(a(), locale_.a());
        }
      }
      return j;
    }
    
    public String toString()
    {
      return "SweepEvent [" + a(this.d) + ", horizontal=" + this.g + ", fixed=" + this.i + ", " + this.e + ']';
    }
    
    private static String a(int paramInt)
    {
      switch (paramInt)
      {
      case 0: 
        return "START";
      case 2: 
        return "END";
      case 1: 
        return "POINT";
      }
      return "NONE";
    }
    
    e_(a.d.w paramw, boolean paramBoolean, s.7 param7)
    {
      this(paramw, paramBoolean);
    }
    
    e_(a.d.w paramw1, a.d.w paramw2, int paramInt, boolean paramBoolean1, boolean paramBoolean2, s.7 param7)
    {
      this(paramw1, paramw2, paramInt, paramBoolean1, paramBoolean2);
    }
  }
  
  static class f_
  {
    private final o a = new a.f.q();
    private final Map b = new HashMap();
    private final Map c = new HashMap();
    private final Map d = new HashMap();
    private final a.c.n e = db.b();
    private final Set f = new HashSet();
    
    void a()
    {
      int j = g.Cc;
      int i = g.Bc;
      Iterator localIterator = this.c.values().iterator();
      do
      {
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          c((List)localIterator.next());
          if (j != 0) {
            break label82;
          }
          if (i != 0) {
            break label76;
          }
        } while (i == 0);
      } while (j != 0);
      localIterator = this.d.values().iterator();
      label76:
      label82:
      if (localIterator.hasNext()) {}
      do
      {
        c((List)localIterator.next());
        if ((j == 0) && (i != 0)) {
          return;
        }
        if (i == 0) {
          break;
        }
        e();
      } while (j != 0);
      f();
    }
    
    void b()
    {
      a();
      j();
      g();
      h();
      a(1, null);
    }
    
    o c()
    {
      return this.a;
    }
    
    void a(a.d.w paramw)
    {
      this.f.add(paramw);
    }
    
    void a(a.d.w[] paramArrayOfw)
    {
      int k = g.Cc;
      int j = g.Bc;
      if (k == 0) {
        if (paramArrayOfw.length < 1) {
          return;
        }
      }
      a.d.w localw1 = paramArrayOfw[0];
      int i = 1;
      do
      {
        if (i >= paramArrayOfw.length) {
          break;
        }
        a.d.w localw2 = paramArrayOfw[i];
        a(localw1, localw2);
        localw1 = paramArrayOfw[i];
        i++;
      } while (j == 0);
    }
    
    void a(a.d.w paramw1, a.d.w paramw2)
    {
      a(paramw1, paramw2, false);
    }
    
    void a(a.d.w paramw1, a.d.w paramw2, boolean paramBoolean)
    {
      int i = g.Cc;
      boolean bool1 = b.a(paramw1.b(), paramw2.b());
      boolean bool2 = b.a(paramw1.a(), paramw2.a());
      if (i == 0) {
        if (bool1)
        {
          if (i != 0) {
            break label54;
          }
          if (bool2) {
            return;
          }
        }
      }
      label54:
      if ((i != 0) || ((!bool1) && (!bool2))) {
        throw new IllegalStateException("Segment is not orthogonal: " + paramw1 + " " + paramw2);
      }
      a.d.w[] arrayOfw = s.a(paramw1, paramw2, bool1);
      a(new s.e_(arrayOfw[0], !bool1, null));
      a(new s.e_(arrayOfw[1], !bool1, null));
      a(new s.e_(arrayOfw[0], arrayOfw[1], 0, bool1, paramBoolean, null));
      a(new s.e_(arrayOfw[1], arrayOfw[0], 2, bool1, paramBoolean, null));
    }
    
    private void a(s.e_ parame_)
    {
      int j = g.Cc;
      int i = g.Bc;
      Double localDouble = new Double(parame_.f() ? parame_.d().b() : parame_.d().a());
      if (j == 0)
      {
        if (parame_.f())
        {
          if (j == 0) {
            if (!this.c.containsKey(localDouble))
            {
              localObject = new z();
              this.c.put(localDouble, localObject);
              if (j != 0) {
                break label195;
              }
              if (i == 0) {
                break label188;
              }
            }
          }
          localObject = (List)this.c.get(localDouble);
          if (j != 0) {
            break label195;
          }
          if (i == 0) {
            break label188;
          }
        }
        if (j != 0) {}
      }
      else if (!this.d.containsKey(localDouble))
      {
        localObject = new z();
        this.d.put(localDouble, localObject);
        if (j != 0) {
          break label195;
        }
        if (i == 0) {
          break label188;
        }
      }
      Object localObject = (List)this.d.get(localDouble);
      label188:
      label195:
      ((List)localObject).add(parame_);
    }
    
    private List d()
    {
      z localz = new z();
      localz.addAll(a(true));
      localz.addAll(a(false));
      return localz;
    }
    
    List a(boolean paramBoolean)
    {
      int j = g.Cc;
      int i = g.Bc;
      z localz = new z();
      Object localObject = this.a.v();
      if (((a.c.w)localObject).e()) {}
      for (;;)
      {
        if (j == 0)
        {
          localz.add(this.a.o(((a.c.w)localObject).d()));
          ((a.c.w)localObject).f();
          if (i == 0)
          {
            if (i == 0) {
              break;
            }
            if (j != 0) {
              continue;
            }
            Collections.sort(localz);
          }
        }
      }
      localObject = new z();
      x localx = this.a.B();
      Iterator localIterator = localz.iterator();
      break label201;
      label110:
      if (localIterator.hasNext()) {}
      label201:
      while (j != 0)
      {
        e locale = b((a.d.w)localIterator.next());
        if (localx.getBool(locale)) {
          break label110;
        }
        b.a_ locala_ = b.a_.a(this.a, locale, paramBoolean);
        if ((j == 0) && (locala_.a().isEmpty())) {
          break label110;
        }
        ((List)localObject).add(locala_);
        a.c.m localm = locala_.a().l();
        if (!localm.e()) {
          break label110;
        }
        localx.a(localm.a().e(), true);
        localx.a(localm.a().f(), true);
        localm.f();
        if ((j != 0) || ((j == 0) && (i != 0)) || ((j == 0) && (i != 0))) {
          return localObject;
        }
        if (i == 0) {
          break;
        }
      }
      this.a.a(localx);
      return localObject;
    }
    
    private d[] a(List paramList)
    {
      int j = g.Cc;
      int i = g.Bc;
      if ((j != 0) || (paramList.size() < 2)) {
        return new d[0];
      }
      Object localObject = null;
      z localz = new z();
      Iterator localIterator = paramList.iterator();
      label115:
      do
      {
        e locale;
        do
        {
          if (!localIterator.hasNext()) {
            break label145;
          }
          locale = b((a.d.w)localIterator.next());
          if (j == 0) {
            if (localObject != null)
            {
              if (j != 0) {
                break label115;
              }
              if (!locale.equals(localObject)) {
                localz.add(this.a.a(localObject, locale));
              }
            }
          }
          if (j != 0) {
            break label139;
          }
          if (localObject == null) {
            break;
          }
          if (j != 0) {
            break label142;
          }
        } while (locale.equals(localObject));
        localObject = locale;
      } while (i == 0);
      label139:
      label142:
      label145:
      return (d[])localz.toArray(new d[localz.size()]);
    }
    
    private e b(a.d.w paramw)
    {
      if (g.Cc == 0) {
        if (this.b.containsKey(paramw)) {
          return (e)this.b.get(paramw);
        }
      }
      e locale = this.a.i();
      this.a.b(locale, 10.0D, 10.0D);
      this.a.a(locale, paramw.a(), paramw.b());
      this.b.put(paramw, locale);
      return locale;
    }
    
    private void c(List paramList)
    {
      int n = g.Cc;
      int m = g.Bc;
      Collections.sort(paramList);
      int i = 0;
      int j = 0;
      z localz1 = new z();
      z localz2 = new z();
      Iterator localIterator = paramList.iterator();
      label194:
      label199:
      label463:
      do
      {
        do
        {
          s.e_ locale_;
          do
          {
            do
            {
              Object localObject;
              do
              {
                if (!localIterator.hasNext()) {
                  break;
                }
                locale_ = (s.e_)localIterator.next();
                if (m != 0) {
                  break label554;
                }
                switch (locale_.a())
                {
                case 0: 
                  if (n == 0) {
                    if (locale_.g()) {
                      j++;
                    }
                  }
                  if (n == 0) {
                    if (!localz1.isEmpty())
                    {
                      if (n != 0) {
                        break label199;
                      }
                      if (locale_.d().equals(localz1.d())) {
                        break label194;
                      }
                    }
                  }
                  localz1.add(locale_.d());
                  localz2.add(j > 0 ? Boolean.TRUE : Boolean.FALSE);
                  if (n == 0)
                  {
                    if (m != 0)
                    {
                      localObject = (Boolean)localz2.d();
                      if (n == 0) {}
                      localz2.g().a((((Boolean)localObject).booleanValue()) || (j > 0) ? Boolean.TRUE : Boolean.FALSE);
                    }
                    i++;
                  }
                  break;
                }
              } while (m == 0);
              if (n != 0) {
                break label554;
              }
              if (n == 0) {
                if (!localz1.isEmpty())
                {
                  if (n != 0) {
                    break label319;
                  }
                  if (locale_.d().equals(localz1.d())) {
                    break label315;
                  }
                }
              }
              localz1.add(locale_.d());
              localz2.add(j > 0 ? Boolean.TRUE : Boolean.FALSE);
              i--;
              if (n == 0) {
                if (i == 0)
                {
                  localObject = a(localz1);
                  int k = 0;
                  a.c.y localy = localz2.h();
                  do
                  {
                    do
                    {
                      if (!localy.e()) {
                        break;
                      }
                      if ((n == 0) && (m != 0)) {
                        break label463;
                      }
                      if (k >= localObject.length) {
                        break;
                      }
                      Boolean localBoolean = (Boolean)localy.j();
                      this.e.a(localObject[k], localBoolean.booleanValue());
                      localy.f();
                      k++;
                    } while (m == 0);
                    localz1.clear();
                    localz2.clear();
                  } while (n != 0);
                }
              }
              if ((n != 0) || ((m != 0) && (i < 0))) {
                throw new IllegalStateException("Event list contains too many end events.");
              }
            } while (!locale_.g());
            j--;
          } while (((n == 0) && (m == 0)) || ((n == 0) && (localz1.isEmpty())) || ((n == 0) && (locale_.d().equals(localz1.d()))));
          localz1.add(locale_.d());
          localz2.add(j > 0 ? Boolean.TRUE : Boolean.FALSE);
        } while (n != 0);
      } while (m == 0);
      label315:
      label319:
      if (i > 0) {
        throw new IllegalStateException("Event list contains too many start events.");
      }
      label554:
    }
    
    private void e()
    {
      int k = g.Cc;
      int j = g.Bc;
      z localz1 = new z();
      Object localObject = this.a.w();
      if (((a.c.m)localObject).e()) {}
      while (k != 0)
      {
        localz1.add(new s.c_(((a.c.m)localObject).a()));
        if (k != 0) {
          break label95;
        }
        ((a.c.m)localObject).f();
        if (j != 0) {
          break label91;
        }
        if (j == 0) {
          break;
        }
      }
      a.d.m.a(localz1, new s.0(this));
      label91:
      label95:
      localObject = localz1.h();
      label238:
      label239:
      do
      {
        if (!((a.c.y)localObject).e()) {
          break;
        }
        s.c_ localc_ = (s.c_)((a.c.y)localObject).j();
        z localz2 = localc_.d();
        if (k == 0)
        {
          if (localz2.size() > 2)
          {
            d[] arrayOfd = a(localz2);
            if (k == 0) {
              if (this.e.getBool(localc_.c()))
              {
                int i = 0;
                do
                {
                  if (i >= arrayOfd.length) {
                    break;
                  }
                  if (k != 0) {
                    break label239;
                  }
                  this.e.a(arrayOfd[i], true);
                  i++;
                  if (j != 0) {
                    break label238;
                  }
                } while (j == 0);
              }
            }
            if (k == 0) {
              this.a.a(localc_.c(), arrayOfd[0].e(), arrayOfd[0].f());
            }
            this.a.a(arrayOfd[0]);
          }
          ((a.c.y)localObject).f();
        }
      } while (j == 0);
    }
    
    private void f()
    {
      int j = g.Cc;
      int i = g.Bc;
      a.c.w localw = new bb(this.a.v()).l();
      label220:
      label237:
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale = localw.d();
        if (j == 0)
        {
          if ((locale.c() == 2) && (!this.f.contains(this.a.o(locale))))
          {
            ab localab = new ab(locale.l());
            d locald1 = localab.m();
            d locald2 = localab.n();
            if (j != 0) {
              continue;
            }
            if (a.d.k.d(this.a.o(locald1.a(locale)), this.a.o(locald2.a(locale)), this.a.o(locale)))
            {
              if (j == 0)
              {
                if (locald1.e().equals(locale))
                {
                  this.a.a(locald1, localab.n().a(locale), locald1.f());
                  if (j != 0) {
                    break label237;
                  }
                }
              }
              else {
                if (i == 0) {
                  break label220;
                }
              }
              this.a.a(locald1, locald1.f(), localab.n().a(locale));
              this.a.a(locald2);
              this.a.a(locale);
              this.b.remove(locale);
            }
          }
          localw.f();
        }
      } while (i == 0);
    }
    
    private void g()
    {
      int j = g.Cc;
      int i = g.Bc;
      bb localbb = new bb();
      a.c.w localw = new bb(this.a.v()).l();
      do
      {
        do
        {
          if (!localw.e()) {
            break;
          }
          if (i != 0) {
            break label97;
          }
          if (localw.d().c() == 0) {
            localbb.add(localw.d());
          }
          localw.f();
        } while (i == 0);
      } while (j != 0);
      label97:
      do
      {
        localw = localbb.l();
        while (i == 0)
        {
          if (!localw.e()) {
            break;
          }
          this.a.a(localw.d());
          localw.f();
        }
      } while (j != 0);
    }
    
    private void h()
    {
      if (g.Cc == 0) {
        if (this.a.l() > 1) {
          return;
        }
      }
      d locald = this.a.q();
      this.a.a(locald);
      e locale = this.a.i();
      this.a.a(locale, a.d.w.d(this.a.o(locald.e()), this.a.o(locald.f())));
      this.a.a(locale, locald.e());
      this.a.a(locale, locald.f());
    }
    
    private s.g_ b(boolean paramBoolean)
    {
      int j = g.Cc;
      int i = g.Bc;
      s.g_ localg_ = new s.g_(this.a.C(), 1.0D, null);
      List localList = d();
      Iterator localIterator = localList.iterator();
      break label72;
      label47:
      if (localIterator.hasNext()) {}
      label72:
      while (j != 0)
      {
        b.a_ locala_ = (b.a_)localIterator.next();
        a.c.m localm = locala_.a().l();
        do
        {
          if (!localm.e()) {
            break;
          }
        } while (j != 0);
        if (i != 0) {
          break label47;
        }
        if (paramBoolean) {
          if (j == 0)
          {
            if (this.e.getBool(localm.a())) {
              localg_.a(localm.a(), (0.0D / 0.0D));
            }
          }
          else
          {
            if (j != 0) {
              break label169;
            }
            if (i == 0) {
              break label160;
            }
          }
        }
        localg_.a(localm.a(), locala_.e());
        localm.f();
        if (i == 0) {
          break;
        }
      }
      label160:
      label169:
      return localg_;
    }
    
    private void j()
    {
      int k = g.Cc;
      int j = g.Bc;
      s.g_ localg_ = b(true);
      ab localab1 = hb.a(this.a, localg_);
      a.c.n localn = this.a.C();
      b.a(localn, localab1);
      ab localab2 = new ab();
      Object localObject = this.a.w();
      while (((a.c.m)localObject).e())
      {
        if (j != 0) {
          break label122;
        }
        if (!localn.getBool(((a.c.m)localObject).a())) {
          localab2.add(((a.c.m)localObject).a());
        }
        ((a.c.m)localObject).f();
        if (j != 0)
        {
          break label166;
          break label164;
        }
      }
      label112:
      label122:
      do
      {
        if ((k != 0) || (!localab2.isEmpty()))
        {
          localObject = localab2.o();
          this.a.a((d)localObject);
          e[] arrayOfe = { ((d)localObject).e(), ((d)localObject).f() };
          int i = 0;
          e locale;
          do
          {
            if (i >= arrayOfe.length) {
              break label112;
            }
            locale = arrayOfe[i];
            if (k != 0) {
              break;
            }
            if ((k == 0) && (j != 0)) {
              return;
            }
          } while (j != 0);
          if (locale.c() == 1)
          {
            if (k != 0) {
              break label273;
            }
            if (!this.f.contains(this.a.o(locale)))
            {
              if (k == 0) {}
              localab2.b(locale.i() != null ? locale.i() : locale.h());
            }
          }
          i++;
          if (j == 0) {
            break;
          }
        }
      } while (k != 0);
      label164:
      label166:
      this.a.a((a.c.n)localg_.a());
      label273:
    }
    
    private void k()
    {
      int j = g.Cc;
      int i = g.Bc;
      s.g_ localg_ = b(true);
      ab localab = hb.a(this.a, localg_);
      a.c.n localn = this.a.C();
      b.a(localn, localab);
      x localx = this.a.B();
      Object localObject1 = localab.l();
      do
      {
        if (!((a.c.m)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.m)localObject1).a();
        localx.a(((d)localObject2).e(), localx.getInt(((d)localObject2).e()) + 1);
        localx.a(((d)localObject2).f(), localx.getInt(((d)localObject2).f()) + 1);
        ((a.c.m)localObject1).f();
      } while (i == 0);
      localObject1 = new bb();
      Object localObject2 = this.a.v();
      while (((a.c.w)localObject2).e())
      {
        localObject3 = ((a.c.w)localObject2).d();
        if ((j == 0) && (i != 0)) {
          break label245;
        }
        if (j == 0)
        {
          if (localx.getInt(localObject3) == 1) {
            if (j != 0) {
              break label232;
            }
          }
        }
        else if (((e)localObject3).c() > 1) {
          ((bb)localObject1).add(localObject3);
        }
        ((a.c.w)localObject2).f();
        if (i != 0) {
          label232:
          break label405;
        }
      }
      label245:
      Object localObject4;
      label282:
      label315:
      do
      {
        do
        {
          do
          {
            do
            {
              if ((j == 0) && (((bb)localObject1).isEmpty())) {
                break;
              }
              break label282;
              localObject2 = ((bb)localObject1).o();
              localObject3 = null;
              localObject4 = ((e)localObject2).l();
              do
              {
                if (!((a.c.m)localObject4).e()) {
                  break label315;
                }
                localObject3 = ((a.c.m)localObject4).a();
                if (i != 0) {
                  break;
                }
                if (localn.getBool(localObject3)) {
                  break label315;
                }
                ((a.c.m)localObject4).f();
              } while (i == 0);
            } while (j != 0);
            if (j == 0)
            {
              if (localObject3 == null) {
                throw new IllegalStateException("Node without MST edge found: " + localObject3);
              }
              localn.a(localObject3, false);
            }
            localObject4 = ((d)localObject3).a((e)localObject2);
            localx.a(localObject4, localx.getInt(localObject4) - 1);
          } while (localx.getInt(localObject4) != 1);
        } while (j != 0);
        ((bb)localObject1).b(localObject4);
        if (j != 0) {
          break;
        }
      } while (i == 0);
      label405:
      localObject2 = (j)this.a.c("y.layout.router.BusRouter.DEBUG_INFO_DPKEY");
      Object localObject3 = this.a.w();
      do
      {
        if (!((a.c.m)localObject3).e()) {
          break;
        }
        localObject4 = ((a.c.m)localObject3).a();
        if (i != 0) {
          return;
        }
        String str = ((j)localObject2).get(localObject4) + " ";
        if (j == 0)
        {
          if (localn.getBool(localObject4)) {
            str = str + "tree ";
          }
          str = str + "cost=" + localg_.getDouble(localObject4);
          ((j)localObject2).a(localObject4, str);
          ((a.c.m)localObject3).f();
        }
      } while (i == 0);
      this.a.a(localx);
      this.a.a((a.c.n)localg_.a());
      if (j == 0) {
        this.a.a(localn);
      }
    }
    
    private void a(int paramInt, d paramd)
    {
      int j = g.Cc;
      int i = g.Bc;
      if (j == 0) {}
      e locale = paramd == null ? l() : paramd.f();
      ab localab = new ab(locale.m());
      a.c.m localm = localab.l();
      do
      {
        do
        {
          if (!localm.e()) {
            break;
          }
          if (i != 0) {
            break label124;
          }
          if (!localm.a().equals(paramd)) {
            this.a.e(localm.a());
          }
          localm.f();
        } while (i == 0);
      } while (j != 0);
      localm = locale.n();
      label124:
      do
      {
        while (i == 0)
        {
          if (!localm.e()) {
            break;
          }
          a(paramInt + 1, localm.a());
          localm.f();
        }
      } while (j != 0);
    }
    
    private e l()
    {
      int j = g.Cc;
      int i = g.Bc;
      Object localObject = null;
      a.c.w localw = this.a.v();
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale = localw.d();
        if (i != 0) {
          break label93;
        }
        if (j == 0)
        {
          if (locale.c() > 1)
          {
            if (j != 0) {
              continue;
            }
            if (!this.f.contains(this.a.o(locale))) {
              localObject = locale;
            }
          }
          localw.f();
        }
      } while (i == 0);
      label93:
      return localObject;
    }
  }
  
  static class d_
  {
    private o a;
    private o b;
    private a.c.k c;
    private Map d;
    private Map e;
    private Set f;
    private x h;
    private ab i;
    private boolean j = true;
    private x k;
    private a.c.k l;
    private a.c.k m;
    
    boolean a()
    {
      return this.j;
    }
    
    void a(boolean paramBoolean)
    {
      this.j = paramBoolean;
    }
    
    ab b()
    {
      return this.i;
    }
    
    void a(a.c.m paramm, o paramo, a.c.k paramk1, a.c.k paramk2)
    {
      int i1 = g.Cc;
      int n = g.Bc;
      if (i1 == 0)
      {
        if (paramm.k() == 0) {
          return;
        }
        paramm.h();
      }
      if (i1 == 0)
      {
        if ((paramm.a().c() instanceof o))
        {
          this.a = ((o)paramm.a().c());
          if (i1 != 0) {
            break label111;
          }
        }
      }
      else {
        if (n == 0) {
          break label87;
        }
      }
      throw new IllegalStateException("Edges must be part of a LayoutGraph.");
      label87:
      this.b = paramo;
      this.l = paramk1;
      this.m = paramk2;
      c();
      e();
      label111:
      Object localObject = paramo.w();
      do
      {
        do
        {
          if (!((a.c.m)localObject).e()) {
            break;
          }
          this.f.add(((a.c.m)localObject).a());
          ((a.c.m)localObject).f();
          if (i1 != 0) {
            break label183;
          }
          if (n != 0) {
            break label177;
          }
        } while (n == 0);
      } while (i1 != 0);
      paramm.h();
      label177:
      label183:
      do
      {
        if (!paramm.e()) {
          break;
        }
        a(paramm.a());
        paramm.f();
        if ((i1 == 0) && (n != 0)) {
          return;
        }
      } while (n == 0);
      while (i1 == 0)
      {
        if (this.j)
        {
          if (n != 0) {
            break label291;
          }
          if ((i1 != 0) || (!this.f.isEmpty()))
          {
            localObject = (d)this.f.iterator().next();
            a((d)localObject, this.e);
            if (n == 0) {
              continue;
            }
          }
        }
        if (i1 == 0) {
          label291:
          d();
        }
      }
    }
    
    private void c()
    {
      this.k = this.b.B();
      this.h = this.b.B();
      this.d = new HashMap();
      this.e = new HashMap();
      this.f = new HashSet();
      this.i = new ab();
      this.c = new s.7(this);
    }
    
    private void d()
    {
      this.b.a(this.h);
      this.b.a(this.k);
      this.f = null;
      this.e = null;
      this.l = null;
      this.m = null;
      this.b = null;
    }
    
    private void a(d paramd)
    {
      int i1 = g.Cc;
      int n = g.Bc;
      try
      {
        e locale1 = ((d)this.l.get(paramd)).f();
        e locale2 = ((d)this.m.get(paramd)).f();
        z localz;
        if (locale1.equals(locale2))
        {
          localz = a(locale1);
          if (i1 != 0) {
            break label87;
          }
          if (n == 0) {}
        }
        else
        {
          localz = a(locale1, locale2);
        }
        this.a.a(paramd, localz);
        label87:
        a.c.y localy = localz.h();
        do
        {
          if (!localy.e()) {
            break;
          }
          a.d.w localw = (a.d.w)localy.j();
          this.e.put(localw, paramd);
          localy.f();
          if ((i1 == 0) && (n != 0)) {
            return;
          }
        } while (n == 0);
        if (i1 != 0) {}
        return;
      }
      catch (IllegalStateException localIllegalStateException)
      {
        this.i.add(paramd);
      }
    }
    
    private void a(d paramd, Map paramMap)
    {
      int i2 = g.Cc;
      int i1 = g.Bc;
      if (i2 == 0) {
        if (!paramMap.containsKey(this.b.o(paramd.e())))
        {
          if (i2 != 0) {
            break label96;
          }
          if (!paramMap.containsKey(this.b.o(paramd.f())))
          {
            a(paramd.e().h(), paramMap);
            a(paramd, paramMap);
            return;
          }
        }
      }
      label96:
      a.d.w localw1;
      if (paramMap.containsKey(this.b.o(paramd.e())))
      {
        localw1 = this.b.o(paramd.e());
        localw2 = this.b.o(paramd.f());
        if (i2 == 0) {
          if (i1 == 0) {
            break label159;
          }
        }
      }
      else
      {
        localw1 = this.b.o(paramd.f());
      }
      a.d.w localw2 = this.b.o(paramd.e());
      label159:
      d locald = (d)paramMap.get(localw1);
      paramMap.put(localw2, locald);
      this.f.remove(paramd);
      a.d.w[] arrayOfw1 = b.b(this.a.n(locald).h());
      a.d.w[] arrayOfw2 = new a.d.w[arrayOfw1.length + 2];
      int n = 0;
      if (!arrayOfw1[n].equals(localw1)) {}
      for (;;)
      {
        if (i2 == 0)
        {
          arrayOfw2[n] = arrayOfw1[n];
          n++;
          if (i1 == 0)
          {
            if (i1 == 0) {
              break;
            }
            if (i2 != 0) {
              continue;
            }
            arrayOfw2[n] = localw1;
          }
        }
      }
      arrayOfw2[(n + 1)] = localw2;
      if (n < arrayOfw1.length)
      {
        arrayOfw2[(n + 2)] = arrayOfw1[n];
        n++;
      }
      for (;;)
      {
        if ((i2 != 0) || (i1 == 0))
        {
          if (i1 == 0) {
            break;
          }
          if (i2 == 0) {
            this.a.a(locald, new a.d.y(arrayOfw2));
          }
        }
      }
    }
    
    private z a(e parame)
    {
      z localz = new z();
      localz.add(this.b.o(parame));
      localz.add(this.b.o(parame.i().e()));
      localz.add(this.b.o(parame.i().e()));
      localz.add(this.b.o(parame));
      this.f.remove(parame.i());
      return localz;
    }
    
    private z a(e parame1, e parame2)
    {
      int i2 = g.Cc;
      int n = this.h.getInt(parame1);
      int i1 = this.h.getInt(parame2);
      if ((i2 != 0) || (n != 0))
      {
        if (i2 != 0) {
          break label59;
        }
        if (i1 != 0) {}
      }
      else
      {
        throw new IllegalStateException("Reached level '0' which is not used in the template graph.");
      }
      label59:
      if (i2 == 0)
      {
        if (i1 < n)
        {
          localObject1 = (d)this.k.get(parame1);
          this.f.remove(localObject1);
          localObject2 = a(((d)localObject1).a(parame1), parame2);
          ((z)localObject2).a(this.b.o(parame1));
          return localObject2;
        }
        if (i2 != 0) {}
      }
      else
      {
        if (n < i1)
        {
          localObject1 = (d)this.k.get(parame2);
          this.f.remove(localObject1);
          localObject2 = a(parame1, ((d)localObject1).a(parame2));
          ((z)localObject2).b(this.b.o(parame2));
          return localObject2;
        }
        if (i2 != 0) {
          break label242;
        }
      }
      if (parame1.equals(parame2))
      {
        localObject1 = new z();
        ((z)localObject1).add(this.b.o(parame1));
        return localObject1;
      }
      label242:
      Object localObject1 = (d)this.k.get(parame1);
      this.f.remove(localObject1);
      Object localObject2 = (d)this.k.get(parame2);
      this.f.remove(localObject2);
      z localz = a(((d)localObject1).a(parame1), ((d)localObject2).a(parame2));
      localz.a(this.b.o(parame1));
      localz.b(this.b.o(parame2));
      return localz;
    }
    
    private void e()
    {
      int i2 = g.Cc;
      int i1 = g.Bc;
      bb localbb = new bb();
      a.c.w localw = this.b.v();
      label116:
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale1 = localw.d();
        if (i2 == 0)
        {
          if (this.h.getInt(locale1) <= 0) {
            if (i2 == 0)
            {
              if (this.c.getBool(locale1)) {
                this.h.a(locale1, 1);
              }
            }
            else
            {
              this.d.put(this.b.o(locale1), locale1);
              localbb.b(locale1);
            }
          }
          do
          {
            for (;;)
            {
              if (!localbb.isEmpty())
              {
                e locale2 = localbb.o();
                int n;
                a.c.m localm;
                d locald;
                e locale3;
                do
                {
                  n = this.h.getInt(locale2) + 1;
                  localm = locale2.l();
                  if (!localm.e()) {
                    break;
                  }
                  locald = localm.a();
                  locale3 = locald.a(locale2);
                } while (i2 != 0);
                if (i1 != 0) {
                  break;
                }
                if (i1 == 0)
                {
                  if (this.h.getInt(locale3) == 0)
                  {
                    this.k.a(locale3, locald);
                    this.h.a(locale3, n);
                    this.d.put(this.b.o(locale3), locale3);
                    if (i2 != 0) {
                      break label291;
                    }
                    if (!this.c.getBool(locale3)) {
                      localbb.b(locale3);
                    }
                  }
                  localm.f();
                  if (i1 == 0) {
                    break label116;
                  }
                }
              }
            }
            localw.f();
          } while (i2 != 0);
        }
      } while (i1 == 0);
      label291:
    }
  }
  
  private static class b_
  {
    private o a;
    private o b;
    private Map c;
    private final Map e = new HashMap();
    private x f;
    private j h;
    private ab i;
    
    private b_() {}
    
    private void a(o paramo1, o paramo2, Map paramMap)
    {
      this.a = paramo2;
      this.b = paramo1;
      this.c = paramMap;
      this.i = new ab();
      this.f = paramo1.B();
      this.h = null;
    }
    
    private void a()
    {
      this.e.clear();
      this.b.a(this.f);
      this.h = null;
      this.a = null;
      this.b = null;
      this.c = null;
    }
    
    ab a(o paramo1, o paramo2, Map paramMap1, Map paramMap2)
    {
      int k = g.Cc;
      int j = g.Bc;
      a(paramo1, paramo2, paramMap1);
      i locali1;
      i locali2;
      if ((k != 0) || (((this.b.c(s.a) instanceof i)) && ((k != 0) || ((this.b.c(s.b) instanceof i)))))
      {
        locali1 = (i)this.b.c(s.a);
        locali2 = (i)this.b.c(s.b);
        if (j == 0) {}
      }
      else
      {
        locali1 = null;
        locali2 = null;
      }
      a.c.m localm = paramo2.w();
      do
      {
        if (!localm.e()) {
          break;
        }
        d locald1 = localm.a();
        e locale1 = a(locald1.e());
        e locale2 = a(locald1.f());
        d locald2 = paramo1.a(locale1, locale2);
        if (k != 0) {
          break label349;
        }
        this.i.add(locald2);
        if (j != 0) {
          break label346;
        }
        a.d.w localw;
        if (k == 0) {
          if (this.f.getBool(locale1))
          {
            localw = paramo2.o(locald1.e());
            paramo1.c(locald2, localw);
            if ((paramMap2 != null) && ((k != 0) || (locali1 != null))) {
              locali1.a(locald2, paramMap2.get(localw));
            }
          }
        }
        if (k == 0)
        {
          if (this.f.getBool(locale2))
          {
            localw = paramo2.o(locald1.f());
            paramo1.d(locald2, localw);
            if (k != 0) {
              continue;
            }
            if ((paramMap2 != null) && ((k != 0) || (locali2 != null))) {
              locali2.a(locald2, paramMap2.get(localw));
            }
          }
          localm.f();
        }
      } while (j == 0);
      if (k == 0) {
        a();
      }
      label346:
      label349:
      return this.i;
    }
    
    private e a(e parame)
    {
      int j = g.Cc;
      a.d.w localw = this.a.o(parame);
      if (j == 0) {
        if (this.c != null)
        {
          if (j != 0) {
            break label172;
          }
          if (this.c.containsKey(localw))
          {
            if (j == 0)
            {
              if (parame.c() == 1)
              {
                locale1 = (e)this.c.get(localw);
                this.f.a(locale1, true);
                return locale1;
              }
              if (j != 0) {}
            }
            else if (this.e.containsKey(localw))
            {
              return (e)this.e.get(localw);
            }
            e locale1 = c(parame);
            e locale2 = (e)this.c.get(localw);
            d locald = this.b.a(locale1, locale2);
            this.b.d(locald, localw);
            this.i.add(locald);
            return locale1;
          }
        }
      }
      label172:
      return c(parame);
    }
    
    private e c(e parame)
    {
      a.d.w localw = this.a.o(parame);
      if (g.Cc == 0) {
        if (this.e.containsKey(localw)) {
          return (e)this.e.get(localw);
        }
      }
      e locale = this.b.i();
      this.b.a(locale, localw);
      this.e.put(localw, locale);
      return locale;
    }
    
    b_(s.7 param7)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.s

 * JD-Core Version:    0.7.0.1

 */